package com.tpp.base.service.impl;

import com.tpp.base.mapper.ItemTypeMapper;
import com.tpp.base.service.AdminItemTypeService;
import com.tpp.comm.pojo.TpItemType;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminItemTypeServiceImpl implements AdminItemTypeService {

    @Resource
    private ItemTypeMapper ItemTypeMapper;

    @Override
    public List<TpItemType> findItemTypes() {
        return ItemTypeMapper.selectList(null);
    }

    @Override
    public void addItemType(TpItemType tpItemType) {
        ItemTypeMapper.insert(tpItemType);
    }

    @Override
    public void updateItemType(TpItemType tpItemType) {
        ItemTypeMapper.updateById(tpItemType);
    }

    @Override
    public void deleteItemType(Integer id) {
        ItemTypeMapper.deleteById(id);
    }

    @Override
    public TpItemType findById(Integer id) {
        return ItemTypeMapper.selectById(id);
    }
}
